#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
using namespace std;

template<class T> void f(T)
{
    size_t n; cin >> n;
    list<T> l;
   
    T cur;
    while(cin >> cur)l.push_back(cur);
    
    for (auto it = l.begin(); it != l.end(); ++it) {
        if (it != l.begin()) cout << "->";
        cout << *it;
    }   cout << endl << endl;
    l.resize(min(n, l.size()));

    auto it1 = l.begin(), it2 = l.end();
    bool jug = true;
    while (it1 != it2 && it1 != --it2) {
        if (*it1++ != *it2) {
            jug = false;
            break;
        }
    }
    if (jug) cout << "true";
    else cout << "false";
}

int main()
{
    int t; cin >> t;
    if (t < 0 || t > 3) cout << "err";
    else if (t == 0)
        f(int());
    else if (t == 1)
        f(double());
    else if (t == 2)
        f(char());
    else if (t == 3)
        f(string());
    return 0;
}